package com.qk.management.mapper;

import com.qk.entity.Dept;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author: hm
 * @Date: 2025/09/29 20:26
 * @Description:
 */
@Mapper
public interface DeptMappper {

    @Select("select * from dept")
    List<Dept> selectAllDepts();

    @Delete("delete from dept where id = #{id}")
    void deleteById(Integer id);
    //@Update("update dept set name = #{name},status = #{status},update_time = #{updateTime} where id = #{id}")

    void update(Dept dept);

    @Select("select * from dept where id = #{id}")
    Dept selectById(Integer id);

    Integer count(@Param("name") String name,
                  @Param("status") Integer status);

    List<Dept> selectByPage(@Param("name")String name,
                            @Param("status") Integer status,
                            @Param("offset") Integer offset,
                            @Param("pageSize") Integer pageSize);

    @Insert("insert into dept(name,status,create_time,update_time) values(#{name},#{status},#{createTime},#{updateTime})")
    void addDept(Dept dept);
}
